package cn.tedu.demo;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author CCFu
 * @version 1.0
 * @date 2021/11/8 19:22
 */
public class Test1 {
    public static void main(String[] args) {
        m1();
    }
    public static void m1(){
        System.out.println("请输入第一个数：");
        int a = new Scanner(System.in).nextInt();
        System.out.println("请输入第二个数：");
        int b = new Scanner(System.in).nextInt();
        System.out.println("请输入第三个数：");
        int c = new Scanner(System.in).nextInt();
//        int num = a+b+c;
//        int max = (a>b?a:b)>c?(a>b?a:b):c;
//        int min = (a<b?a:b)<c?(a<b?a:b):c;
//        int z = num - max - min;
//        System.out.println("["+min+","+z+","+max+"]");
//        m1();
        int[] arr = new int[3];
        arr[0] = a;
        arr[1] = b;
        arr[2] = c;
        int temp;
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = i; j < arr.length ; j++) {
                if (arr[i]>arr[j]) {
                    temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
        m1();
    }
}
